package com.kukudexin.time.mayikt.stream;

import com.kukudexin.time.mayikt.entity.UserEntity;

import java.util.ArrayList;
/**
 * @author: 酷酷的鑫
 * @Date: 2022/1/12 11:53
 * @description:
 */
public class SkipLambdaTest {
    public static void main(String[] args) {
        ArrayList<UserEntity> userEntities = new ArrayList<>();
        userEntities.add(new UserEntity("mayikt", 20));
        userEntities.add(new UserEntity("meite", 28));
        userEntities.add(new UserEntity("zhangsan", 35));
        userEntities.add(new UserEntity("liusi", 21));
        userEntities.add(new UserEntity("wangmazi", 19));
        userEntities.add(new UserEntity("xiaoke", 19));
        userEntities.add(new UserEntity("xiaoan", 21));

        userEntities.stream().skip(2).limit(5).forEach(userEntity -> System.out.println(userEntities.toString()));
    }
}
